<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group(['middleware' => ['guest']], function() {

    Route::view('login', 'backend.login')->name('login');;

    Route::post('login','HomeController@login');
});


Route::group(['middleware' => ['auth']], function() {
    Route::view('', 'backend.dashboard');

    Route::view('dashboard', 'backend.dashboard');

    Route::post('logout','HomeController@logout');

    Route::resource('roles', 'RoleController');

    Route::resource('photo/types', 'TypesController');

    Route::post('photo/types/delete', 'TypesController@batchDelete');

    Route::get('photo/upload','PhotosController@showUpload');

    Route::view('photo/slides','backend.photos.slides',['title' => 'Slides']);

    Route::get('photos/{photo}/slide','PhotosController@slide');

    Route::resource('photos', 'PhotosController');

    Route::resource('videos', 'VideosController');

    Route::resource('feedback', 'FeedbackController');

    Route::get('feedback/{feedback}/review','FeedbackController@review');

    Route::post('photos/delete', 'PhotosController@batchDelete');

});